<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10的阶乘</title>
    <script>
        document.write("for循环<br>");
        var sum=1;
        for(var i=1;i<=10;i++){
            sum*=i;
        }
        document.write("10!=",sum);
        document.write('<br>');
        document.write('<br>');
        document.write('<br>');
        document.write("while循环<br>");
        var i1=1;
        var sum1=1;
        while(i1<=10){
            sum1*=i1;
            i1++;
        }
        document.write("10!=",sum);
    </script>
</head>
<body>
    
</body>
</html>